Skip to content

Add edge/contour shape locator (find rectangles/shapes without a template)#342

Merged
JE-Chen merged 1 commit into
devfrom
feat/shape-locator-batch
Jun 22, 2026
Merged

Add edge/contour shape locator (find rectangles/shapes without a template)#342
JE-Chen merged 1 commit into
devfrom
feat/shape-locator-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 22, 2026

Copy link
Copy Markdown
Member

Locate clickable regions on a screen you have never seen — no template, colour or text needed.

  • find_shapes (AC_find_shapes): Canny edge detection + contour extraction → bounding boxes of every distinct shape ({x,y,width,height,area,center,aspect}, largest first). min_area/max_area drop specks and the full-frame border.
  • find_rectangles (AC_find_rectangles): keeps only contours that approximate to a convex quadrilateral (buttons / cards / input fields). aspect_range=(min,max) filters w/h (e.g. (1.5,8) wide buttons, (0.8,1.2) square icons); epsilon is the approxPolyDP tolerance.
  • Complements the visual lane: template/feature matching need a sample, colour-region needs a colour, OCR needs text — this answers the structural "where are the boxes?" question so a script can enumerate elements and click the Nth.
  • Injectable haystack (ndarray/path/PIL) → headless-testable on synthetic arrays. Reuses visual_match._haystack_gray. Wired through all 5 layers + headless test + EN/Zh docs + WHATS_NEW. Qt-free.

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit b15c51d into dev Jun 22, 2026
15 of 16 checks passed
@JE-Chen JE-Chen deleted the feat/shape-locator-batch branch June 22, 2026 20:19
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant